import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Main',
    component: () => import(/* webpackChunkName: "main" */ '../views/Main.vue'),
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'Home',
        component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue')
      },
      {
        path: '/article/:id',
        name: 'Article',
        component: () => import(/* webpackChunkName: "article" */ '../views/Article.vue'),
        props: true
      }
    ]
  },
  {
    path: '/hero/:id',
    name: 'Hero',
    component: () => import(/* webpackChunkName: "hero" */ '../views/Hero.vue'),
    props: true
  },
  {
    path: '/herodetail/:id',
    name: 'HeroDetailImg',
    component: () => import(/* webpackChunkName: "herodetailimg" */ '../views/HeroDetailImg.vue'),
    props: true
  },
  {
    path: '/heroList',
    name: 'HeroList',
    component: () => import(/* webpackChunkName: "herolist" */ '../views/HeroList.vue')
  },
  {
    path: '/skins/:id',
    name: 'Skin',
    component: () => import(/* webpackChunkName: "skin" */ '../views/Skin.vue'),
    props: true
  }
]

const router = new VueRouter({
  routes
})

export default router
